<template>
  <div class="page transform-demo">
    <div class="out">
      <div class="top"></div>
      <div class="bottom"></div>
      <div class="left"></div>
      <div class="right"></div>
      <div class="in">
        <div>Look at me!</div>
      </div>
    </div>
    <div class="circlebox">
      <button class="circle"></button>
    </div>
  </div>
</template>
<script setup>
import {} from "vue";
</script>
<style lang="scss">
.transform-demo {
  .out,
  .out > * {
    box-sizing: border-box;
  }
  .out {
    width: 200px;
    height: 200px;
    margin: 50px auto;
    background-color: skyblue;
    position: relative;
  }
  .out > div {
    position: absolute;
    transition: all .7s ease;
  }
  .out .left,
  .out .right {
    height: 140px;
    width: 1px;
    top: 30px;
    transform: rotateX(80deg);
  }
  .out:hover .left,
  .out:hover .right {
    transform: rotateX(0deg);
    background-color: white;
  }
  .out .left {
    left: 30px;
  }
  .out .right {
    left: 170px;
  }
  .out .top,
  .out .bottom {
    width: 140px;
    height: 1px;
    left: 30px;
    transform: rotateY(80deg);
  }
  .out:hover .top,
  .out:hover .bottom {
    transform: rotateY(0deg);
    background-color: white;
  }
  .out .top {
    top: 30px;
  }
  .out .bottom {
    top: 170px;
  }
  .out .in {
    height: 139px;
    width: 139px;
    left: 31px;
    top: 31px;
    overflow: hidden;
  }
  .out .in > * {
    height: 139px;
    width: 139px;
    line-height: 139px;
    text-align: center;
    color: transparent;
    font-size: 24px;
    font-family: 方正启体简体, serif;
    background-color: skyblue;
    transform: translateY(50px);
    transition: all .7s ease;
  }
  .out:hover .in > * {
    transform: translateY(0px);
    color: white;
  }
  .circlebox {
    height: 360px;
    width: 640px;
    margin: 100px auto;
    position: relative;
  }
  .circle {
    display: inline-block;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    height: 50px;
    width: 50px;
    border-radius: 25px;
    border: 2px solid white;
    transition: all 0.5s ease;
    box-shadow: rgba(255, 255, 255, 0.8) 0 0 20px;
    background-color: rgba(0, 0, 0, 0);
  }
  .circle:hover {
    cursor: pointer;
    box-shadow: rgba(255, 255, 255, 1) 0 0 30px;
  }
}
</style>